from llama_index.embeddings.huggingface import HuggingFaceEmbedding

print('使用本地嵌入模型（节省成本）')
embedding_model = HuggingFaceEmbedding(
    model_name="BAAI/bge-small-zh-v1.5",  # 中文优化模型
    device="cpu"
)
embeddings = embedding_model.get_text_embedding(
    "你好，我是天涯兰"
)
print(embeddings[:15])
